package com.helloniu.mvc {

import com.helloniu.mvc.TController;
import com.helloniu.fl.util.Tool;
import com.helloniu.fl.NCHandler;
import flash.net.NetConnection;

// template viewer
public class TViewer {	
	public function TViewer(vname:String = null) {
        super();

        viewName = vname;
    }

    public function setName(aviewName:String):void {
        viewName = aviewName
    }

    public function getName():String {
        return viewName;
    }

    // called by controller, when c.addViewer is called
    public function setController(c:TController):void {
        controller = c;
    }

	// private
    private function getController():TController {
        return controller;
    }
    
    public function setEnabled(enb:Boolean = false):void {
    	// @temp tonyy
    	// this.enabled = enb;
    	Tool.traceT("---enabled---: " + enb);
    }

    private function notifyModelInfoChanged(sth:*):void {
        controller.notifyModelInfoChanged(sth);
    }

    // called by controller
    // update model info
    public function updateModelInfo(sth:*):void {
        // viewer execute sth
        Tool.traceT("---viewer do sth--: " + sth);
    }

    private var viewName:String;
    private var controller:TController;
}
}